package com.clds.kotlinforbusinesslisting.module

import android.content.Context
import dagger.Module
import dagger.Provides
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import javax.inject.Singleton

/**
 * Created by zhiweijin on 17-6-28.
 */
@Module
class ApplicationModel(context: Context) {
    val context=context;
    @Provides fun getmContext() =context;

    @Provides
    @Singleton
    fun getRetrofit():Retrofit{
        var okhttpclient=OkHttpClient.Builder().build()

        return Retrofit.Builder()
                .baseUrl("http://www.baidu.com")
                .client(okhttpclient)
                .build()


    }


}